<?php

use yii\helpers\Html;
use yii\widgets\DetailView;

/* @var $this yii\web\View */
/* @var $model backend\models\JjrUserWithdraw */

$this->title = '查看提现';
$this->params['breadcrumbs'][] = ['label' => 'Jjr User Withdraws', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="jjr-user-withdraw-view">

    <h1><?= Html::encode($this->title) ?></h1>

    <p>
        <?= Html::a('Update', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
        <?= Html::a('Delete', ['delete', 'id' => $model->id], [
            'class' => 'btn btn-danger',
            'data' => [
                'confirm' => 'Are you sure you want to delete this item?',
                'method' => 'post',
            ],
        ]) ?>
    </p>

    <?= DetailView::widget([
        'model' => $model,
        'attributes' => [
            'id',
            'jjr_user_commission_id',
            'jjr_user_id',
            'amount',
            'card_no',
            'bank_name',
            'card_real_name',
            'bank_branch_name',
            'create_time',
            'update_time',
            'fail_reason',
            [ 'attribute'=>'transfer_status','label'=>'提现状态','value'=>function($model){
                if($model['transfer_status']==\backend\models\JjrUserCommission::TRANSFER_NOT_START){
                    return '未转账';
                }else if($model['transfer_status']==\backend\models\JjrUserCommission::TRANSFER_STARTED){
                    return '转账中';
                }else if($model['transfer_status']==\backend\models\JjrUserCommission::TRANSFER_END){
                    return '已转账';
                }else if($model['transfer_status']==\backend\models\JjrUserCommission::TRANSFER_FAIL){
                    return '转账失败';
                }
            }],
        ],
    ]) ?>

</div>
    <!-- 定义数据块 -->
<?php $this->beginBlock('test'); ?>
    jQuery(document).ready(function() {
    highlight_subnav('jjr-user-withdraw/index'); //子导航高亮
    });
<?php $this->endBlock() ?>
    <!-- 将数据块 注入到视图中的某个位置 -->
<?php $this->registerJs($this->blocks['test'], \yii\web\View::POS_END); ?>